---
section: 6-Deprecated API
order: 11
name: '[Deprecated] ClassNames'
---

import { ClassNamesObj, ClassNamesDynamic, ClassNamesComposition } from '../examples/class-names';

# \[Deprecated\] ClassNames

> **Deprecated**<br />
> We do not recommend using `ClassNames` or the `className` prop in any code. Please use [`css`](/api-css-prop) or [`cssMap`](/api-cssmap) instead.

Use a component where styles are not necessarily used on a JSX element.

<ClassNamesObj />

## Dynamic declarations

Change a [CSS declaration](https://developer.mozilla.org/en-US/docs/Learn/CSS/First_steps/How_CSS_is_structured#Properties_and_values) at runtime,
powered by [CSS variables](https://developer.mozilla.org/en-US/docs/Web/CSS/Using_CSS_custom_properties).
Make sure to set the `style` prop.

<ClassNamesDynamic />

## Composing styles

Composing styles through props allows your consumers to add and override styles.
Make sure to pass through `className` and `style`.

<ClassNamesComposition />
